from django.urls import path, re_path
from rest_framework.urlpatterns import format_suffix_patterns

from tutorial.views import (
    ArticleListView,
    HtmlReportView,
    JSONDataAPIView,
    MyAPIView,
    SimpleAPIView
)

urlpatterns = [
    path('param/<int:param>/', SimpleAPIView.as_view(), name='param-api'),
    path('create', JSONDataAPIView.as_view(), name='body-req'),
    path('code/<int:param1>/<slug:param2>/', MyAPIView.as_view(), name='my-api'),
    re_path(r'^articles/(?P<year>\d{4})/(?P<month>\d{2})/$', ArticleListView.as_view(), name='article-list'),
    path('html/', HtmlReportView.as_view(), name='article-list'),
]

urlpatterns = format_suffix_patterns(urlpatterns)
